/**
 * 
 * The GameState class holds the connection state.
 * 
 * Author: Matthias Van Eeghem <matthias@van-eeghem.com>
 * All rights reserved.
 * 
 */

package com.bomberman.core;

public class GameState 
{
	// Hold the game state
	static private eState gameState;
	
	// Enum with all possible states
	public static enum eState
	{
		GameStateDisconnected,
		GameStateConnecting,
		GameStateConnected
	}
	
	/**
	 * Set the game state
	 * 
	 * @param state
	 */
	public static void setGameState(eState state)
	{
		gameState = state;
	}
	
	/**
	 * Return the game state
	 * 
	 * @return
	 */
	public static eState getGameState()
	{
		return gameState;
	}
	
	/**
	 * This method returns a string from the connection state
	 * 
	 * @return
	 */
	public static String getStateAsString()
	{
		if(gameState == eState.GameStateConnecting)
		{
			return "Connecting..";
		}
		
		if(gameState == eState.GameStateConnected)
		{
			return "Connected.";
		}
		
		return "Disconnected.";
	}
}
